<div class="panel-admin">
	<h1>Add category</h1>
	<div class="form-admin">
		<?php 
			//foreach ($catlist as $catitem) {
                           //     echo $catitem->id;
              //          }
			$form=$this->beginWidget('CActiveForm', array(
				'id'=>'category_form',
	            'enableClientValidation'=>true,
	            'clientOptions'=>array(
	                'validateOnSubmit'=>true,
            ),
            //'focus'=>array($model,'$name'),
        )); ?>
		<table>
			<tr>
                    <td><?php echo $form->labelEx($model,'name'); ?></td>
                    <td>
                        <?php echo $form->textField($model,'name', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'name', array('class'=>'error')); ?>
                    </td>
                </tr>
			<tr>
                    <td><?php echo $form->labelEx($model,'description'); ?></td>
                    <td>
                        <?php echo $form->textArea($model,'description', array('class'=>'textbox-admin')); ?>
                        <?php echo $form->error($model,'description', array('class'=>'error')); ?>
                    </td>
                </tr>
			
			<tr>
				<td>Parent</td>
				<td>
					 <?php  
					 // $model -> doi tuong chua cac thuoc tinh cua db
					 // parent -> column
					 echo $form->dropDownList($model,'parent', $catlist, array('class'=>'textbox-admin')); ?>
				</td>
			</tr>
			
			<tr>
				<td>&nbsp;</td>
				<td>
					<?php echo CHtml::submitButton('Save', array("class"=>"button-admin")); ?>
				</td>
			</tr>
		</table>
		<?php $this->endWidget(); ?>
	</div>
</div>